package o;

import androidx.annotation.NonNull;
import java.io.File;
import java.util.List;
import o.sg.d;
import o.tg.a;
import o.vk.c;

class ta implements tg, d<Object> {
    private File ʻ;
    private int ʼ;
    private volatile c<?> ʽ;
    private int ˊ;
    private sa ˋ;
    private final List<sa> ˎ;
    private final tj<?> ˏ;
    private final a ॱ;
    private List<vk<File, ?>> ᐝ;

    ta(tj<?> tjVar, a aVar) {
        this(tjVar.ͺ(), tjVar, aVar);
    }

    ta(List<sa> list, tj<?> tjVar, a aVar) {
        this.ˊ = -1;
        this.ˎ = list;
        this.ˏ = tjVar;
        this.ॱ = aVar;
    }

    public boolean ˎ() {
        boolean z = false;
        while (true) {
            if (this.ᐝ != null && ॱ()) {
                break;
            }
            this.ˊ++;
            if (this.ˊ >= this.ˎ.size()) {
                break;
            }
            sa saVar = (sa) this.ˎ.get(this.ˊ);
            this.ʻ = this.ˏ.ˋ().ˋ(new te(saVar, this.ˏ.ʼ()));
            if (this.ʻ != null) {
                this.ˋ = saVar;
                this.ᐝ = this.ˏ.ˎ(this.ʻ);
                this.ʼ = 0;
            }
        }
        this.ʽ = null;
        while (!z && ॱ()) {
            boolean z2;
            List list = this.ᐝ;
            int i = this.ʼ;
            this.ʼ = i + 1;
            this.ʽ = ((vk) list.get(i)).ˎ(this.ʻ, this.ˏ.ᐝ(), this.ˏ.ʽ(), this.ˏ.ˊ());
            if (this.ʽ == null || !this.ˏ.ˊ(this.ʽ.ˎ.ˋ())) {
                z2 = z;
            } else {
                z2 = true;
                this.ʽ.ˎ.ˏ(this.ˏ.ˎ(), this);
            }
            z = z2;
        }
        return z;
    }

    private boolean ॱ() {
        return this.ʼ < this.ᐝ.size();
    }

    public void ˏ() {
        c cVar = this.ʽ;
        if (cVar != null) {
            cVar.ˎ.ॱ();
        }
    }

    public void ॱ(Object obj) {
        this.ॱ.ˏ(this.ˋ, obj, this.ʽ.ˎ, rz.DATA_DISK_CACHE, this.ˋ);
    }

    public void ˏ(@NonNull Exception exception) {
        this.ॱ.ˋ(this.ˋ, exception, this.ʽ.ˎ, rz.DATA_DISK_CACHE);
    }
}
